#include <bits/stdc++.h>
using namespace std;
int cloud[1001][1001], s[1001][1001];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      char ch;
      cin >> ch;
      if (ch == '.')
        cloud[i][j] = 0;
      else if (ch == '#')
        cloud[i][j] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      s[i][j] = s[i][j - 1] + cloud[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << s[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}